import React from 'react';
import { Spin } from 'antd';
import ReactEcharts from 'echarts-for-react';

export default class CommonEchartComp extends React.Component {
  render() {
    const { option = {}, containerStyle = { width: 300, height: 300 }, load = {} } = this.props;
    const { loading = false, loadmsg = '加载中...' } = load;
    return (
      <Spin spinning={loading} tip={loadmsg}>
        <div style={containerStyle}>
          <ReactEcharts
            option={option}
          />
        </div>
      </Spin>
    );
  }
}
